<template>
	<view class="selectStore">
		<navBar isBack backColor="#fff" background="transparent"></navBar>
		<!-- store电话 -->
		<view class="storePhone">
			<image :src="`${baseImg}/static/adminShop/selectStore/bg.png`" mode=""></image>
			<view class="phoneBox">
				<image :src="parentData.parentUser.headimg" mode=""></image>
				<view class="phone">{{parentData.parentUser.realname}}</view>
			</view>
			<view class="whiteBox"></view>
		</view>
		
		<!-- 店铺列表 -->
		<view class="storeList" v-if="role=='shop'">
			<view class="item" v-for="(item,index) in parentData.parentData" :key="index" @click="selectStore(item.partner_id)">
				<image :src="item.logo" mode=""></image>
				<view class="right omit-1">
					{{item.shopname}}
					<view class="toStore">
						进入店铺
						<i class="iconfont icon-jinru"></i>
					</view>
				</view>
			</view>
		</view>
		<view class="storeList" v-else>
			<view class="item" v-for="(item,index) in parentData.parentData" :key="index">
				<image :src="item.logo" mode=""></image>
				<view class="right omit-1">
					{{item.shopname}}
					<!-- <view class="toStore">
						进入店铺
						<i class="iconfont icon-jinru"></i>
					</view> -->
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import service_enter from '@/service/enter.js'
	export default{
		data(){
			return{
				baseImg:this.$static,
				parentData:[],
				role:''
			}
		},
		onLoad(options) {
			this.role = this.$store.state.index.role;
			this.parentData = JSON.parse(decodeURIComponent(options.data))
			console.log(this.parentData,'111')
			console.log(options,'options')
		},
		methods:{
			
			// 选择店铺进入
			selectStore(storeId){
				console.log(storeId,'选择的店铺')
				uni.navigateTo({
					url:'/pages/mall/store/store?storeId='+storeId
				})
			}
		}
	}
</script>

<style lang="less">
	page{
		height: 100%;
	}
	.selectStore{
		height: 100%;
		background-color: #fff;
		position: relative;
		.storePhone{
			position: absolute;
			top: 0;
			left: 0;
			width: 100%;
			height: 568rpx;
			image{
				width: 100%;
				height: 568rpx;
			}
			.phoneBox{
				position: absolute;
				top: 50%;
				left: 0;
				right: 0;
				bottom: 0;
				transform: translateY(-25%);
				display: flex;
				flex-direction: column;
				align-items: center;
				font: 400 36rpx/48rpx PingFangSC-Regular;
				color: #fff;
				image{
					width: 120rpx;
					height: 120rpx;
					border-radius: 50%;
				}
				.phone{
					margin-top: 18rpx;
				}
			}
			.whiteBox{
				position: absolute;
				bottom: -2rpx;
				left: 0;
				width: 100%;
				height: 112rpx;
				background-color: #fff;
				border-radius: 60rpx 60rpx 0px 0px;
			}
		}
		.storeList{
			width: 100%;
			margin-top: 568rpx;
			position: absolute;
			top: 0;
			left: 0;
			background-color: #fff;			padding-bottom: constant(safe-area-inset-bottom);			padding-bottom: env(safe-area-inset-bottom);
			.item{
				width: 598rpx;
				height: 180rpx;
				margin: 0 auto 80rpx;
				background-color: #F8F6F3;
				display: flex;
				align-items: center;
				border-radius: 16rpx;
				padding: 30rpx 60rpx;
				box-shadow: 0px 4rpx 12rpx rgba(0, 0, 0, 0.1);
				image{
					width: 120rpx;
					height: 120rpx;
					border-radius: 50%;
					margin-right: 60rpx;
				}
				.right{
					font: 400 36rpx/82rpx PingFang SC;
					color: #1A1C20;
					.toStore{
						font: 400 24rpx/24rpx PingFang SC;
						color: #939393;
						display: flex;
						align-items: center;
						.iconfont{
							font-size: 22rpx;
						}
					}
				}
			}
		}
	}
</style>
